<?php
abstract class ServiceFactory {

    private static $userService = null;
    private static $contactService = null;
    private static $smsService = null;

    static function getUserService() {
        if (self::$userService == null) {
            self::$userService = new UserServiceImpl();
        }
        return self::$userService;
    }

    static function getContactService() {
        if (self::$contactService == NULL) {
            self::$contactService = new ContactServiceImpl();
        }
        return self::$contactService;
    }

    static function getSMSService() {
        if (self::$smsService == NULL) {
            self::$smsService = new SMSServiceImpl();
        }
        return self::$smsService;
    }

}
?>
